package com.item.yxlottery.yxlottery.activity;

/*
 *------------------------------
 * @创建者      Administrator
 * @创建时间    2016/12/21 16:48
 * @文件描述    双色球开奖号码界面
 *------------------------------
 */

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.item.yxlottery.yxlottery.R;
import com.item.yxlottery.yxlottery.adapter.ExpandableItemAdapter;
import com.item.yxlottery.yxlottery.base.BaseActivity;
import com.item.yxlottery.yxlottery.bean.OpenSsqLotteryBean;
import com.item.yxlottery.yxlottery.bean.SsqBonusDetailBean;
import com.zhy.autolayout.AutoRelativeLayout;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class OpenSsqNumberActivity extends BaseActivity {

    @Bind(R.id.rv_openssq_list)
    RecyclerView mRvList;
    private ArrayList<MultiItemEntity> mList;
    private ExpandableItemAdapter mExpandableItemAdapter;
    private boolean mClickState;

    @Override
    protected void setCustomActionBar(ImageButton ibActionbarLeft, TextView tvActionBarTitle, ImageButton ibActionbarRight, AutoRelativeLayout layoutActionbar) {
        ibActionbarLeft.setImageResource(R.drawable.leftarrow);
        ibActionbarLeft.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                OpenSsqNumberActivity.this.finish();
            }
        });
        ibActionbarRight.setVisibility(View.GONE);
        tvActionBarTitle.setText("双色球  开奖号码");
    }

    @Override
    protected View initView() {
        View view = View.inflate(this, R.layout.activity_openssqnumber, null);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    protected void initData() {
        mList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            OpenSsqLotteryBean openSsqLottery = new OpenSsqLotteryBean("第2016149期", "2016-12-20  21:15:00 (周二)", "3,20,23,26,32,33,7");
            SsqBonusDetailBean bonusDetail = new SsqBonusDetailBean("342258704", "1069092085", "5", "7413987  ", "77", "195940  ", "1404", "3000  ", "67314", "200  ",
                    "1225433", "10  ", "15485589", "5  ", "7", "12345  ", "12234", "123456  ");
            openSsqLottery.addSubItem(bonusDetail);
            mList.add(openSsqLottery);
        }

        mExpandableItemAdapter = new ExpandableItemAdapter(this, mList);
        mRvList.setLayoutManager(new LinearLayoutManager(this));
        mRvList.setAdapter(mExpandableItemAdapter);
    }

    @Override
    protected void initEvent() {

    }
}
